
package SomeStuff;

import dk.eleit.FullScreen;
import dk.eleit.LineObject;
import java.awt.*;

public class FullScreenTest1 {

    public static void main(String[] args) {

        FullScreen fs = new FullScreen(1280,720,32);
        
        LineObject obj1 = new LineObject(180);
        
        double a1 = 0.0;
        double a2 = 0.0;
        for(int i=0; i<180; i++) {
            obj1.setPoint(i, Math.cos(Math.toRadians(a1))*50.0f, Math.sin(Math.toRadians(a1))*50.0f, Math.cos(Math.toRadians(a2))*50.0);
            a1 += 2.0;
            a2 += 4.0;
        }
        
        double aX = 0.0;
        double aY = 0.0;

        long difTime;
        long oldTime = System.currentTimeMillis();
        while( fs.getRunFlag() ) {
            difTime = System.currentTimeMillis() - oldTime;
            oldTime = System.currentTimeMillis();

            aX += 0.05 * difTime;
            aY += 0.033 * difTime;
            if(aX >= 360.0) aX -= 360.0;
            if(aY >= 360.0) aY -= 360.0;
            
            obj1.setRotation(aX, aY, 0);
            
            Graphics g = fs.getGraphics();
            g.setColor(Color.black);
            g.fillRect(0, 0, 1280, 720);
            g.setColor(Color.decode("0x112244"));
            g.fillRect(0, 100, 1280, 520);
            g.setColor(Color.decode("0x224488"));
            g.drawLine(0, 98, 1280, 98);
            g.drawLine(0, 621, 1280, 621);
            obj1.drawObject(g, 1280, 720);
            fs.show();
            g.dispose();
        }
    }
}
